<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        // 1.想要一个变量自己加1 num=num+1 比较麻烦
        var num = 1
        num = num + 1 //++num
        num = num + 1 //3 
        console.log(num);
        // 2.前置递增运算符 ++ 写在变量的前面
        var age = 10
        ++age //类似于age = age + 1
        console.log(age);
        //3.先加1 后返回值
        var p = 10
        console.log(++p + 10);//21
        // ++p类似于p = p + 1 然后返回给左边的p  再加上10就等于21
    </script>
</head>

<body>

</body>

</html>